#ifndef __SPACEDEFENDER_Vector_H
#define __SPACEDEFENDER_Vector_H

#include <string>
namespace spacedefender {

class Vector {
public:
	double i,j,k ;


	Vector operator+ (const Vector &v) const;
	Vector operator- (const Vector &v) const;
	Vector operator* (double scalar) const;
	inline Vector operator* (const Vector &v) const;
	inline Vector operator/ (const Vector &v) const;
	double  length() const;

	static double distance(const Vector &v1, const Vector &v2);
	static double dotProduct(const Vector &v1, const Vector &v2);
	static Vector crossProduct(const Vector &v1, const Vector &v2);

	/**
	 * Returns the vector v = v2 - v1
	 * @param v1 Vector start position
	 * @param v2 Vector target position
	 * @return
	 */
	static Vector DistanceVector(const Vector &v1, const Vector &v2);

	// pre: length()!=0
	void normalize();

	Vector ();
	Vector (float i, float j, float k);
	Vector (double i, double j, double k);

	std::string ToString() const ;
};
}
#endif // __SPACEDEFENDER_Vector_H
